package com.gxa.xiaoucomeshome.service.impl;

import com.gxa.xiaoucomeshome.mapper.LogMapper;
import com.gxa.xiaoucomeshome.pojo.Log;
import com.gxa.xiaoucomeshome.service.LogService;
import com.gxa.xiaoucomeshome.vo.LogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class LogServiceImpl implements LogService {
    @Autowired
    LogMapper logMapper;

    @Override
    public void insertLog(Log log) {
        logMapper.insertLog(log.getLog_type(),
                log.getLog_admin_id(),log.getLog_content());
//        log.getLog_time(),
    }

    @Override
    public List<LogVo> getSelectLog(Integer page, Integer size,
                                  String log_type,
                                  Date start_log_time,
                                  Date end_log_time) {
        List<LogVo> selectLog = logMapper.getSelectLog(page, size,log_type,start_log_time,end_log_time);
        return selectLog;
    }

    @Override
    public Integer selectLogCount(String log_type, Date start_log_time, Date end_log_time) {
        Integer integer = logMapper.selectLogCount(log_type, start_log_time, end_log_time);
        return integer;
    }
}
